//
//  Constants.h
//  Walmart
//
//  Created by zen on 15/9/11.
//  Copyright (c) 2015年 e6. All rights reserved.
//


#define SK_TRY_BODY(__target) \
@try {\
{__target}\
}\
@catch (NSException *exception) {\
    NSLog(@"%@",exception);\
}\
@finally {\
\
}

#define LocalString(key) \
        [NSBundle.mainBundle localizedStringForKey:(key) value:@"" table:nil]

#define WebServiceSubmitMessage  LocalString(@"正在提交,请稍候...")
#define WebServiceRequeryMessage LocalString(@"正在查询,请稍候...")
#define RouterEvent_AlertMessage @"kRE_AlertMessage"
#define RouterEvent_EndEditing   @"kRE_EndEditing"
#define NOT_LocationUpDate       @"NOT_LocationUpDate"
#define PageSize 20

#define UISCREEN_WIDTH  [UIScreen mainScreen].bounds.size.width
#define UISCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height

#define nstr(format,...) [NSString stringWithFormat:format,__VA_ARGS__]

#ifndef RGB
#define RGB(x) [UIColor colorWithRed:((x & 0xff0000) >> 16)/255.0 green:((x & 0x00ff00) >> 8)/255.0 blue:(x & 0x0000ff)/255.0 alpha:1.0]
#define RGBA(x, a) [UIColor colorWithRed:((x & 0xff0000) >> 16)/255.0 green:((x & 0x00ff00) >> 8)/255.0 blue:(x & 0x0000ff)/255.0 alpha:a]
#endif

#define Font(x) [UIFont systemFontOfSize:(x)]
#define BoldFont(x) [UIFont boldSystemFontOfSize:(x)]
#define HelveticaLight_Font(x) [UIFont fontWithName:@"Helvetica-Light" size:(x)]
#define Helvetica_Font(x) [UIFont fontWithName:@"Helvetica" size:(x)]
#define RADIANS(degrees) ((degrees * M_PI) / 180.0)

#define GetSystemVersion ([[[UIDevice currentDevice] systemVersion]floatValue])


#ifndef dispatch_main_async_safe
#define dispatch_main_async_safe(block) dispatch_async(dispatch_get_main_queue(), block);
#endif


#if Build4Debug == 0

//调试代码块
#define debug_BODY(__target)
//禁用NSLog
#define NSLog( ... )
#define JPFDebugBody(__target)

#else

//调试代码块
#define debug_BODY(__target) __target
#define JPFDebugBody(__target)   __target

#endif

